#pragma once

#include "DuiLib\UIlib.h"

#include "ColdEyes.h"
#include "ColdEyesDlg.h"
#include "File\Record.h"
#include "ExHardDriver\ExHardDrive.h"

using namespace DuiLib;


typedef struct CopyInfo
{
	int id;
	CTime bTime;
	RECORD_FILE_TYPE fileType;
	CopyType copyType;
}CopyInfo;

class CCopyingMsgWnd
	:public WindowImplBase
{
public: 
	CCopyingMsgWnd();
	~CCopyingMsgWnd();

	virtual void OnFinalMessage(HWND);
	virtual CDuiString GetSkinFile();
	virtual LPCTSTR GetWindowClassName(void) const;
	virtual void Notify(TNotifyUI &msg);
	virtual void InitWindow();
	virtual void OnTimer(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
	virtual LRESULT OnSysCommand(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
	LRESULT HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

	void Copy(CopyInfo* info);

	void RefreshPro(int n);

	void SetMsg(LPCTSTR text1);

	bool OnButtonCancel(void* param);

private:
	CDuiString m_sSkinType;
	CProgressUI* pProgress;
	CButtonUI* pButton_cancel;
	CTextUI* pTitle;


public:
	static int MessageBox(HWND hParent, LPCTSTR sSkinType, LPCTSTR title, WPARAM wParam, LPARAM lParam) {
		CCopyingMsgWnd* pWnd = new CCopyingMsgWnd();

		pWnd->m_sSkinType = sSkinType;
		pWnd->Create(hParent, _T("msgWnd"), WS_POPUP | WS_CLIPCHILDREN, WS_EX_TOOLWINDOW);
		pWnd->CenterWindow();
		pWnd->SetMsg(title);
		pWnd->Copy((CopyInfo*)lParam);
		return pWnd->ShowModal();
	}

};